import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;

/**
 * @author zhangxufeng@meitunmama.com 2019-08-25 22:19:13
 */
public class DeleteZookeeperNode {

  public static void main(String[] args) throws Exception {
    CuratorFramework framework = CuratorFrameworkFactory
        .builder()
        .connectString("localhost:2181")
        .sessionTimeoutMs(1000)
        .connectionTimeoutMs(1000)
        .retryPolicy(new ExponentialBackoffRetry(1000, 3))
        .build();
    framework.start();
    framework.delete().deletingChildrenIfNeeded().forPath("/kafka");
  }

}
